﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IRCServer.Entities.Commands
{
    public abstract class IRCCommandBase
    {
        public IRCCommandBase(string message)
        {
            string[] parameters = Utilities.CommandParser.GetParameters(message);

            if (parameters.Length == 0 || parameters[0].ToLower() != this.CommandName().ToLower())
            {
                throw new InvalidOperationException();
            }
        }

        public abstract string CommandName();

        public abstract string ExecuteCommand(SessionBase session);
    }
}
